<template>
    <header>
        <div class="header-left">
          <icon>&#xe624;</icon>
        </div>
        <div class="header-input">
          <icon>&#xe632;</icon>
          <span>输入城市/景点/游玩主题</span>
          </div>
        <router-link to="/city">
          <div class="header-right">{{city}}<icon class="arrow-icon">&#xe64a;</icon></div>
        </router-link>
    </header>
</template>
<script>
import { mapState } from "vuex";
import icon from "icon/icon";
export default {
  name: "HomeHeader",
  components: {
    icon
  },
  mounted() {},
  computed:{
    ...mapState(['city'])
  }
};
</script>
<style lang="stylus" scoped>
@import '~styles/varibles.styl';

header {
  display: flex;
  line-height: $headerHeight;
  background: $bgColor;
  color: #ffffff;

  .header-left {
    width: 0.64rem;
    float: left;
    font-size: 0.4rem;
    text-align: center;
  }

  .header-input {
    display: flex;
    flex: 1;
    background: #fff;
    border-radius: 0.1rem;
    margin-top: 0.12rem;
    line-height: 0.62rem;
    height: 0.62rem;
    margin-left: 0.1rem;
    color: #ccc;
    padding-left: 0.2rem;

    span {
      padding-left: 0.1rems;
    }
  }

  .header-right {
    min-width: 1.04rem;
    padding: 0 0.1rem;
    float: right;
    text-align: center;
    color: #ffffff;
  }

  .arrow-icon {
    font-size: 0.25rem;
  }
}
</style>
